{extends file="./main.tpl"}
{block name=head}
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<style type="text/css" title="currentStyle">
  @import "media2/css/demo_page.css";
	@import "media2/css/demo_table.css";
	@import "media2/css/themes/base/jquery-ui.css";
	@import "media2/css/themes/smoothness/jquery-ui-1.7.2.custom.css";
</style>
<script src="media2/js/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="media2/js/jquery.dataTables.min.js" type="text/javascript"></script>
<script src="media2/js/jquery-ui.js" type="text/javascript"></script>
<script src="media2/js/jquery.dataTables.columnFilter.js" type="text/javascript"></script>
<style type="text/css">
  .one { width:50px; }
</style>
<script type="text/javascript" charset="utf-8">
 $(document).ready(function () {
  $('#example').dataTable().columnFilter({ sPlaceHolder: "head:after",
  aoColumns: 
  [
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" },
    { type: "text" }
  ]
    });
    
  });
function myFunction(obj)
{
  window.location.href = 'sellItem.php?narration='+narration+'&loanId='+obj.id;
}
</script>
{/block}
{block name=body}
<form name="soldFrm" method="post">
  <table align="center">
    <tr>
      <td valign="bottom">
      	<form name="form1" action="./soldItem.php" method="get">
          <select name="selectLoanType" autofocus="autofocus">
            {html_options values=$comboValues output=$comboOutput selected=$comboSelected}
          </select>
        </form>
      </td>
      <td><input type="submit" name="SubmitForSold" id="go" value="Go"></td>
    </tr>
  </table>
</form>

<body id="dt_example">
<table cellpadding="0" style="margin-left:1px;" cellspacing="0" border="1" align="left" class="display" id="example" >
	<thead>
		<tr style="background-color:#F6AF3A;">
			<th>Loan No</th>
			<th>Party Name</th>
			<th>Pending Month</th>
			<th>Pending Amount</th>
			<th>Mobile</th>
			<th>Fine</th>
			<th>Gold Value</th>
			<th>Item Location</th>
			{if $comboSelected == 'Sold'}
			  <th>Narretion</th>
			  <th>Sold Date</th>
			  <th>Delete</th>
			{else}
			  <th>Sell</th>
			{/if}
		</tr>
		<tr>
		  <th>Loan No</th>
			<th>Party Name</th>
			<th>Pending Month</th>
			<th>Pending Amount</th>
			<th>Mobile</th>
			<th>Fine</th>
			<th>Gold Value</th>
			<th>Item Location</th>
		</tr>
	</thead>
	<tbody>
	  {section name=rec loop=$regularArray}
			<tr align="left">
        <td align="center">{$regularArray[rec].loanId}</td>
        <td>{$regularArray[rec].accountName}</td>
        <td align="center">{$regularArray[rec].pendingMonth}</td>
        <td align="right">{$regularArray[rec].pendingAmount}</td>
        <td>{$regularArray[rec].mobile}</td>
        <td align="center">{$regularArray[rec].fine}</td>
        <td align="right">{$regularArray[rec].gold}</td>
        <td>{$regularArray[rec].itemlocationName}</td>
        {if $comboSelected == 'Sold'}
			    <td>{$regularArray[rec].soldNarration}</td>
			    <td nowrap >{$regularArray[rec].soldDate}</td>
			    <td><a href="deleteSoldItem.php?loanId={$regularArray[rec].loanId}">delete</a></td>
			  {else}
          <td>
            <a href="sellItemDetail.php?sellId={$regularArray[rec].loanId}" id="{$regularArray[rec].loanId}" >Sell</a>
          </td>
        {/if}
      </tr>
	  {/section} 
  </tbody>
</table>
</body>
{/block}